﻿<?php
    require_once('../../code/global.php');
    require_once('/code/SiteInfo.php');
    require_once('/code/News.php');
    if(!isset($_GET['nid'])) {header('Location:/news');exit;}
    $nid=intval($_GET['nid']);
    $news=new News();
    $n=$news->getNewsById($nid);
    if(empty($n)) {header('Location:/news');exit;}
    $siteInfo=new SiteInfo();
    $s=$siteInfo->getSiteInfo();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="<?php echo $s['meta_keyword'] ?>" />  
        <meta name="keyword" content="<?php echo $s['meta_description'] ?>" />
        <title>News | <?php echo $s['site_name'] ?></title>
        <link rel="shortcut icon" href="/styles/images/icon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="/styles/styles.css" />
    </head>
    <body>
        <div id="container">
            <div id="stripe"></div>
            <a href="/" title="<?php echo $s['site_name'] ?>"><div id="header">
            </div></a>
            <div id="menu">
                <ul><li><a href="/gallery">Gallery</a></li><li class="seperator">|</li><li class="current">News</li><li class="seperator">|</li><li><a href="/about">About us</a></li><li class="seperator">|</li><li><a href="/contact">Contact us</a></li></ul>
            </div>
            <div id="content">
                <div id="leftmenu">
                    <ul>
                        <li id="selected"><a>News from <?php echo $s['site_name']; ?></a></li>
                        <li><a href="/news">Back to News List...</a></li>
                    </ul>
                </div>
                <div id="rightpanel">
                    <h1><?php echo $n['caption']; ?></h1>
                    <div class="time">published on <?php echo date('l j F Y', strtotime($n['create_time'])); ?></div>
                    <?php if($n['img_url']!='') echo '<img src="'.$n['img_url'].'">'; echo $n['content']; ?>
                </div>
            </div>
            <div id="stripe"></div>
            <div id="footer">
                &copy; <?php echo $s['site_name'] ?> All rights reserved.
                <ul><li><a href="/about/terms-conditions">Terms & Conditions</a></li><li>|</li><li><a href="/about">About us</a></li><li>|</li><li><a href="/contact">Contact us</a></li><ul>
            </div>
            <div id="stripe"></div>  
        </div>
    </body>
</html>
